package com.pactera.madp.cp.handler;

import com.alibaba.ttl.TransmittableThreadLocal;
import lombok.experimental.UtilityClass;

@UtilityClass
public class AgentContextHolder {

    private final static ThreadLocal<Integer> AGENT_LOCAL_TENANT = new TransmittableThreadLocal<>();

    public void setAgentId(Integer agentId){
        AGENT_LOCAL_TENANT.set(agentId);
    };

    public Integer getAgentId(){
        return AGENT_LOCAL_TENANT.get();
    }

    public void remove(){
        AGENT_LOCAL_TENANT.remove();
    }

}
